import request from '@/utils/request'

// 获取状态信息
export function saveCmInfo(data) {
  return request({
    url: '/monitor_api/clusterwh/saveCmInfo',
    method: 'post',
    data: data
  })
}

// 获取状态信息
export function saveHostInfo(data) {
  return request({
    url: '/monitor_api/clusterwh/saveHostInfo',
    method: 'post',
    data: data
  })
}

// 获取状态信息
export function saveUserUnit(data) {
  return request({
    url: '/monitor_api/clusterwh/saveUserUnit',
    method: 'post',
    data: data
  })
}

// 获取主机页面维护信息
export function selClusterInfo(params) {
  return request({
    url: '/monitor_api/clusterwh/selClusterInfo',
    method: 'get',
    params
  })
}

// 获取主机页面维护信息
export function selHostInfo(params) {
  return request({
    url: '/monitor_api/clusterwh/selHostInfo',
    method: 'get',
    params
  })
}

// 获取队列用户机构信息
export function selUserUnit(params) {
  return request({
    url: '/monitor_api/clusterwh/selUserUnit',
    method: 'get',
    params
  })
}
export function queryHiveMetastore(params) {
  return request({
    url: '/monitor_api/clusterwh/queryHiveMetastore',
    method: 'get',
    params
  })
}

export function del(ids) {
  return request({
    url: '/monitor_api/clusterwh/delCmInfo',
    method: 'delete',
    data: ids
  })
}

export function upMonitorFlag(data) {
  return request({
    url: '/monitor_api/clusterwh/upMonitorFlag',
    method: 'post',
    data: data
  })
}

export function saveAdInfo(data) {
  return request({
    url: '/monitor_api/clusterwh/saveAdInfo',
    method: 'post',
    data: data
  })
}

export function selAdInfo(data) {
  return request({
    url: '/monitor_api/clusterwh/selAdInfo',
    method: 'post',
    data: data
  })
}

export function refreshCluster(data) {
  return request({
    url: '/monitor_api/clusterwh/refreshCluster',
    method: 'post',
    data: data
  })
}

export function upLoad(data) {
  return request({
    url: '/monitor_api/clusterwh/saveKrbConf',
    method: 'post',
    data: data
  })
}

export function saveHiveMetastore(data) {
  return request({
    url: '/monitor_api/clusterwh/saveHiveMetastore',
    method: 'post',
    data: data
  })
}

export default { saveCmInfo, selClusterInfo, selHostInfo, saveHostInfo, del, selUserUnit, saveUserUnit, upMonitorFlag, saveAdInfo, selAdInfo, refreshCluster, upLoad, saveHiveMetastore, queryHiveMetastore}
